/*
 * @lc app=leetcode.cn id=1684 lang=typescript
 *
 * [1684] 统计一致字符串的数目
 */

// @lc code=start
function countConsistentStrings(allowed: string, words: string[]): number {
    const list = new Set<string>(allowed.split(""));
    return words.filter((ii) => {
        for (let i = 0; i < ii.length; i++) {
            if (!list.has(ii[i])) return false;
        }
        return true;
    }).length;
}
// @lc code=end
